<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>体验店信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/kpoint/kPointMain/">体验店信息列表</a></li>
		<li class="active"><a href="${ctx}/kpoint/kPointMain/form?id=${kPointMain.id}">体验店信息<shiro:hasPermission name="kpoint:kPointMain:edit">${not empty kPointMain.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="kpoint:kPointMain:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form enctype="multipart/form-data" id="inputForm" modelAttribute="kPointMain" action="${ctx}/kpoint/kPointMain/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">体验店名称：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">地理位置：</label>
			<div class="controls">
				<sys:treeselect id="sysAreaId" name="sysAreaId.id" value="${kPointMain.sysAreaId.id}" labelName="sysAreaId.name" labelValue="${kPointMain.sysAreaId.name}"
					title="区域" url="/sys/area/treeData" cssClass="required" allowClear="true" notAllowSelectParent="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">门牌号：</label>
			<div class="controls">
				<form:input path="houseNumber" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">详细地址：</label>
			<div class="controls">
				<form:input path="fullAddress" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">邮政编码：</label>
			<div class="controls">
				<form:input path="postcode" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<%-- <div class="control-group">
			<label class="control-label">坐标点：</label>
			<div class="controls">
				<form:input path="coordinatePoint" htmlEscape="false" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div> --%>
		<div class="control-group">
			<label class="control-label">经度：</label>
			<div class="controls">
				<form:input path="longitude" htmlEscape="false" class="input-xlarge required number"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">纬度：</label>
			<div class="controls">
				<form:input path="latitude" htmlEscape="false" class="input-xlarge required number"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">联系人：</label>
			<div class="controls">
				<form:input path="contact" htmlEscape="false" maxlength="100" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">固定电话：</label>
			<div class="controls">
				<form:input path="landlinePhone" htmlEscape="false" maxlength="30" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">移动电话：</label>
			<div class="controls">
				<form:input path="mobilePhone" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">营业时间：</label>
			<div class="controls">
				<form:input path="businessHours" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">交通信息：</label>
			<div class="controls">
				<form:input path="trafficInfo" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">封面效果图：</label>
			<div class="controls">
				<%-- <input type="hidden" id="imageUrl" name="imageUrl" value="${pageContext.request.contextPath}${kPointMain.imageUrl}" />
				<sys:ckfinder input="imageUrl" type="thumb" uploadPath="/kpoint/kPointMain" selectMultiple="false"/> --%>
				<c:if test="${kPointMain.imageUrl ne null && kPointMain.imageUrl ne '' }">
					<img src="${fns:getConfig('fastdfs_file_url')}${kPointMain.imageUrl}" style="width:auto;height:80px;"/><br><br>
				</c:if>
				<input type="hidden" name="imageUrl" value="${kPointMain.imageUrl}" />
				<input id="storeFileName" type="text" readonly="readonly" style="width:360px;margin-bottom:0px;"/>
		   		<input accept="image/*" name="storeFile" id="storeFile" type="file" style="display:none" />
		      	<input id="storeFileSelect" class="btn btn-primary" type="button" value="选择图片" onclick="$('#storeFile').click();" />
				<script type="text/javascript">
					$('#storeFile').change(function() {
						var fileValue = document.getElementById("storeFile").files; 
						$('#storeFileName').val(fileValue[0].name);  
					});
				</script>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">直播地址：</label>
			<div class="controls">
				<form:input path="linkUrl" htmlEscape="false" maxlength="255" class="input-xlarge"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">描述：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="1000" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="kpoint:kPointMain:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>